package com.abigdreamer.im.client.module.login;

import java.awt.Image;

import com.abigdreamer.im.client.resourse.ResourcesManagement;
import com.abigdreamer.im.client.ui.BaseFrame;


public class EIMNetSetFrame extends BaseFrame {
    
	private static EIMNetSetFrame instance;
	
	public static EIMNetSetFrame GetInstance(){
		if(instance==null){
			instance=new EIMNetSetFrame();
		}
		return instance;
		
	}
    private  EIMNetSetFrame() {
        initComponents();
//        initTxtSocket();
    }
    
    /**
     * 
     *
     */
    private void initTxtSocket(){
//        QQClientTextSocket qqClientTextSocket=QQClientTextSocket.getInstance() ;
//        String ip=serIP_jTextField.getText().trim().toLowerCase();
//        int port=Integer.parseInt(serverPort_jTextField.getText());
//        qqClientTextSocket.setServer_IP_Port(ip);
//        qqClientTextSocket.setServer_Socket_Port(port);
    }

    
    private void initComponents() {
        jPanel7 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        ip_jTextField = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        port_jTextField = new javax.swing.JTextField();
        test_jButton = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jComboBox2 = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        serIP_jTextField = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        serverPort_jTextField = new javax.swing.JTextField();
        exit_jButton = new javax.swing.JButton();
        netSure_jButton = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        newLogin_jRadioButton = new javax.swing.JRadioButton();
        oldLogin_jRadioButton = new javax.swing.JRadioButton();
        image_jLabel = new javax.swing.JLabel();

        jPanel7.setBackground(new java.awt.Color(51, 204, 255));
        jPanel1.setBackground(new java.awt.Color(51, 204, 255));
        jPanel3.setBackground(new java.awt.Color(51, 204, 255));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "\u7f51\u7edc\u8bbe\u7f6e", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 13), new java.awt.Color(255, 0, 51)));
        jLabel1.setText("\u7c7b\u578b\uff1a");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "UDP", "Tcp/Ip", "Http" }));

        jLabel2.setText("\u5730\u5740\uff1a");

        ip_jTextField.setText("127.0.0.1");

        jLabel3.setText("\u7aef\u53e3\uff1a");

        port_jTextField.setText("9090");

        test_jButton.setText("\u6d4b\u8bd5");
        test_jButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                test_jButtonMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(ip_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(36, 36, 36)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(test_jButton)
                        .addComponent(port_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(132, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ip_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(port_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
                .addComponent(test_jButton))
        );
        jPanel3.getAccessibleContext().setAccessibleName(" System");

        jPanel4.setBackground(new java.awt.Color(51, 204, 255));
        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "\u767b\u5165\u670d\u52a1\u5668", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 13), new java.awt.Color(255, 0, 51)));
        jLabel4.setText("\u7c7b\u578b\uff1a");

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "UDP", "Tcp/Ip", "Http" }));

        jLabel5.setText("\u5730\u5740\uff1a");

        serIP_jTextField.setText("127.0.0.1");

        jLabel6.setText("\u7aef\u53e3\uff1a");

        serverPort_jTextField.setText("9090");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(107, 107, 107)
                        .addComponent(jLabel6))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(serIP_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(37, 37, 37)
                        .addComponent(serverPort_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(131, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(serIP_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(serverPort_jTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(23, Short.MAX_VALUE))
        );
        jPanel4.getAccessibleContext().setAccessibleName("2222");

        exit_jButton.setText("\u53d6\u6d88");
        exit_jButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                exit_jButtonMouseClicked(evt);
            }
        });

        netSure_jButton.setText("\u786e\u5b9a");
        netSure_jButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                netSure_jButtonMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(388, Short.MAX_VALUE)
                .addComponent(exit_jButton)
                .addGap(56, 56, 56)
                .addComponent(netSure_jButton)
                .addGap(34, 34, 34))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(34, 34, 34)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(exit_jButton)
                    .addComponent(netSure_jButton))
                .addContainerGap())
        );
        jTabbedPane1.addTab("\u7f51\u7edc\u8bbe\u7f6e", jPanel1);

        jPanel5.setBackground(new java.awt.Color(51, 204, 255));
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "\u767b\u5165\u7a97\u53e3", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 13), new java.awt.Color(255, 0, 51)));
        newLogin_jRadioButton.setBackground(new java.awt.Color(102, 204, 255));
        newLogin_jRadioButton.setFont(new java.awt.Font("宋体", 1, 12));
        newLogin_jRadioButton.setText("\u4f7f\u7528\u6700\u65b0\u7248\u7684\u767b\u5f55\u7a97\u53e3");
        newLogin_jRadioButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        newLogin_jRadioButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        newLogin_jRadioButton.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                newLogin_jRadioButtonStateChanged(evt);
            }
        });

        oldLogin_jRadioButton.setBackground(new java.awt.Color(102, 204, 255));
        oldLogin_jRadioButton.setFont(new java.awt.Font("宋体", 1, 12));
        oldLogin_jRadioButton.setText("\u4f7f\u7528\u7ecf\u5178\u767b\u5f55\u7a97\u53e3");
        oldLogin_jRadioButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        oldLogin_jRadioButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
        oldLogin_jRadioButton.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                oldLogin_jRadioButtonStateChanged(evt);
            }
        });

        Image image=ResourcesManagement.getImage("ui/old.jpg",301,184);
        image_jLabel.setIcon(new javax.swing.ImageIcon(image));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(newLogin_jRadioButton)
                    .addComponent(oldLogin_jRadioButton))
                .addGap(69, 69, 69)
                .addComponent(image_jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 301, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(23, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(newLogin_jRadioButton)
                        .addGap(22, 22, 22)
                        .addComponent(oldLogin_jRadioButton))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(image_jLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(65, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jTabbedPane1.addTab("\u767b\u5165\u8bbe\u7f6e", jPanel2);

        jTabbedPane1.getAccessibleContext().setAccessibleName("table1");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 597, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        this.setResizable(false);
        pack();
    }                       

    private void oldLogin_jRadioButtonStateChanged(javax.swing.event.ChangeEvent evt) {                                                   
    }                                                  

    private void newLogin_jRadioButtonStateChanged(javax.swing.event.ChangeEvent evt) {                                                   
    }                                                  

  /**
  * 确定按钮 的鼠标事件
  * @param evt
  */
 private void netSure_jButtonMouseClicked(java.awt.event.MouseEvent evt) {
//	initTxtSocket();
	 this.setVisible(false);
	 EIMLoginWindow loginFrame=EIMLoginWindow.getInstance();
	 loginFrame.setEnabled(true);
	 BaseFrame.centerWindow(loginFrame);
	 loginFrame.setVisible(true);
 	 
 	
 }                                          

    private void exit_jButtonMouseClicked(java.awt.event.MouseEvent evt) { 
    	this.setVisible(false);
    	EIMLoginWindow loginFrame=EIMLoginWindow.getInstance();
	 loginFrame.setEnabled(true);
	 BaseFrame.centerWindow(loginFrame);
	 loginFrame.setVisible(true);
    }                                         

    private void test_jButtonMouseClicked(java.awt.event.MouseEvent evt) {                                          

    }                                         
    
    
    // 变量声明 - 不进行修改                     
    private javax.swing.JButton exit_jButton;              //取消按钮
    private javax.swing.JLabel image_jLabel;
    public javax.swing.JTextField ip_jTextField;          //网路IP
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton netSure_jButton;              //确定按钮
    private javax.swing.JRadioButton newLogin_jRadioButton;
    private javax.swing.JRadioButton oldLogin_jRadioButton;
    public javax.swing.JTextField port_jTextField;           //网络端口
    public javax.swing.JTextField serIP_jTextField;          //服务器的IP
    public javax.swing.JTextField serverPort_jTextField;     //服务器的端口
    private javax.swing.JButton    test_jButton;              //测试按钮
    // 变量声明结束                   
}
    

